package ${package.Entity};

import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.io.Serial;

/**
* ${table.comment}
* @author by ${author}
* <p>
* ${date}
*/
@Data
@Accessors(chain =true)
@NoArgsConstructor

@Schema(name = "${table.comment}")
public class ${entity} implements Serializable {
    /**
    * 序列化字段
    */
    @Serial    @Schema(description = "序列化字段",hidden = true)
    private static final long serialVersionUID = 1L;
<#list table.fields as field>
    <#if field.keyFlag>
    /**
    * ${field.name}
    */
    @Schema(description = "${field.comment}")
    @TableId
    private ${field.propertyType} ${field.propertyName};
    <#-- 普通字段 -->
    <#elseif !field.keyFlag>
    /**
    * ${field.comment}
    */
    @Schema(description = "${field.comment}")
    private ${field.propertyType} ${field.propertyName};
    <#-- 逻辑删除注解 -->
    <#elseif (logicDeleteFieldName!"") == field.name>
    /**
    * ${field.comment}
    */
    @TableLogic
    @Schema(description = "${field.comment}")
    private ${field.propertyType} ${field.propertyName};
    <#elseif field.propertyType == "LocalDateTime">
    /**
    * ${field.comment}
    */
    @Schema(description = "${field.comment}")
    private Date ${field.propertyName};
    <#elseif field.propertyType != "LocalDateTime">
    /**
    * ${field.comment}
    */
    @Schema(description = "${field.comment}")
    private String ${field.propertyName};
    </#if>
</#list>
}